import type { Doc, DocList } from "@/types/doc";
import { request } from "@/utils/request";

// 查询所有列表
export const all = (ebookId: number) => request<DocList>(`/doc/all?ebookId=${ebookId}`);
// 编辑/新增
export const save = (doc: Doc, content: string) =>
  request("/doc/save", "POST", {
    ...doc,
    content,
  });
// 根据id删除
export const del = (ids: string) => request(`/doc/del/${ids}`, "DELETE");
